﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using LayeredArchitectureSample.DataTransferObjects;
using LayeredArchitectureSample.DomainModel;

namespace LayeredArchitectureSample.ServiceContracts
{
    [ServiceContract(Name = "TripManager", Namespace = "TODO")]
    public interface ITripManager
    {
        /// <exception cref="EntityRetrievalException"></exception>
        [OperationContract(Name = "GetAllTrips")]
        [FaultContract(typeof(EntityRetrievalException))]
        IEnumerable<TripDto> GetAll();

        /// <exception cref="EntityRetrievalException"></exception>
        /// <exception cref="EntityNotFoundException"></exception>
        /// <exception cref="OperationFailedException"></exception>
        [OperationContract(Name = "CreateShippedTrip")]
        [FaultContract(typeof(CannotAddEntityException))]
        [FaultContract(typeof(EntityNotFoundException))]
        [FaultContract(typeof(OperationFailedException))]
        [FaultContract(typeof(ArgumentException))]
        TripDto CreateShippedTrip(RouteDto route, IEnumerable<WareUnitsCountedDto> waresToTake);

        /// <exception cref="EntityRetrievalException"></exception>
        /// <exception cref="OperationFailedException"></exception>
        /// <exception cref="EntityNotFoundException"></exception>
        [OperationContract(Name = "MarkTripAsArrived")]
        [FaultContract(typeof(EntityRetrievalException))]
        [FaultContract(typeof(EntityNotFoundException))]
        [FaultContract(typeof(OperationFailedException))]
        TripDto MarkAsArrived(long tripId);
    }
}